(function ( exports ) {

    //region Xrm2011MetadataValue

    function Xrm2011MetadataValue ( value, type, requireTypeDef ) {
        COSA.XrmValue.call(this, value);
    }

    COSA.Util.deriveOverride(COSA.XrmValue, Xrm2011MetadataValue, {
        namespace:'http://schemas.microsoft.com/xrm/2011/Metadata'
    });

    //endregion Xrm2011MetadataValue

    //region AttributeTypeCode

    function AttributeTypeCode ( typeCode ) {
        Xrm2011MetadataValue.call(this, typeCode);
    }

    COSA.Util.deriveOverride(Xrm2011MetadataValue, AttributeTypeCode, {
        type:'AttributeTypeCode',
        requireTypeDef:true
    });

    //endregion AttributeTypeCode

    //region AttributeRequiredLevel

    function AttributeRequiredLevel ( requiredLevel ) {
        Xrm2011MetadataValue.call(this, requiredLevel);
    }

    COSA.Util.deriveOverride(Xrm2011MetadataValue, AttributeRequiredLevel, {
        type:'AttributeRequiredLevel',
        requireTypeDef:true
    });

    //endregion AttributeRequiredLevel

    //region ImeMode

    function ImeMode ( imeMode ) {
        Xrm2011MetadataValue.call(this, imeMode);
    }

    COSA.Util.deriveOverride(Xrm2011MetadataValue, ImeMode, {
        type:'ImeMode',
        requireTypeDef:true
    });

    //endregion ImeMode

    //region StringFormat

    function StringFormat ( stringFormat ) {
        Xrm2011MetadataValue.call(this, stringFormat);
    }

    COSA.Util.deriveOverride(Xrm2011MetadataValue, StringFormat, {
        type:'StringFormat',
        requireTypeDef:true
    });

    //endregion StringFormat

    //region IntegerFormat

    function IntegerFormat ( format ) {
        Xrm2011MetadataValue.call(this, format);
    }

    COSA.Util.deriveOverride(Xrm2011MetadataValue, IntegerFormat, {
        type:'IntegerFormat',
        requireTypeDef:'true'
    });

    //endregion IntegerFormat

    //region OwnershipType

    function OwnershipType ( type ) {
        Xrm2011MetadataValue.call(this, type, 'OwnershipTypes', true);
    }

    COSA.Util.deriveOverride(Xrm2011MetadataValue, OwnershipType, {
        type:'OwnershipTypes',
        requireTypeDef:true
    });

    //endregion OwnershipType

    //region DateTimeFormat

    function DateTimeFormat ( format ) {
        Xrm2011MetadataValue.call(this, format);
    }

    COSA.Util.deriveOverride(Xrm2011MetadataValue, DateTimeFormat, {
        type:'DateTimeFormat',
        requireTypeDef:true
    });

    //endregion DateTimeFormat

    //region RelationshipType

    function RelationshipType ( type ) {
        Xrm2011MetadataValue.call(this, type);
    }

    COSA.Util.deriveOverride(Xrm2011MetadataValue, RelationshipType, {
        type:'RelationshipType',
        requireTypeDef:true
    });

    //endregion RelationshipType

    exports.AttributeTypeCode = AttributeTypeCode;
    exports.AttributeRequiredLevel = AttributeRequiredLevel;
    exports.ImeMode = ImeMode;
    exports.StringFormat = StringFormat;
    exports.IntegerFormat = IntegerFormat;
    exports.OwnershipType = OwnershipType;
    exports.DateTimeFormat = DateTimeFormat;
    exports.RelationshipType = RelationshipType;
})(COSA);
